﻿@model WeProjectsModel.Notice

@{
    ViewBag.Title = "Create";
}
<style type="text/css">
    section.container form > div {
        margin-top: 10px;
        margin-bottom: 10px;
    }
</style>
<script type="text/javascript" charset="utf-8" src="~/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="~/ueditor/ueditor.all.min.js"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<script type="text/javascript" charset="utf-8" src="lang/zh-cn/zh-cn.js"></script>
<h2>发布通知</h2>
<p class="buttonIn">
    @Html.ActionLink("返回列表", "Index")
</p>
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    @*<table class="gridtable">
            <tr><td style="background-color: #dedede; width: 10%;">标题</td>
        <td>@Html.EditorFor(model => model.Title)
        @Html.ValidationMessageFor(model => model.Title)
        </td>
        </tr>        <tr>
                    <td style="background-color: #dedede; width: 10%;">正文</td>
                    <td>
                        <script id="editor" type="text/plain" style="width:100%;height:300px;">
                        </script>
                        <input type="hidden" id="NewsContent" name="NewsContent" />
                </td>
            </tr>
                </table>*@
    <div class="form-group">
        <label class="control-label width-40p">标题</label>
        @Html.EditorFor(model => model.Title)
        @Html.ValidationMessageFor(model => model.Title)
    </div>
    <div class="form-group">
        <label class="control-label width-40p" style="vertical-align:top;">内容</label>
        <div style="display:inline-block;overflow:hidden;zoom:1;width:90%">
            <script id="editor" type="text/plain" style="width:100%;height:300px;">
            </script>
            <input type="hidden" id="NewsContent" name="NewsContent" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label width-40p"></label>
        <input type="submit" value="发布" class="btn btn-success" />
    </div>
}

        @*<script src="/Scripts/jquery-2.1.4.js"></script>*@
        <script type="text/javascript">
            var ue = UE.getEditor('editor');
            $('form').submit(function () {
                $('#NewsContent').val(ue.getContent());
            });
        </script>
        @section Scripts {
            @Scripts.Render("~/bundles/jqueryval")
        }
